package com.hs.entity.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author hs
 * @since 2023-08-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Message implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 用户ID
     */
    private Integer userId;

    // 接收消息的用户ID(数据库中并不存在该字段)
    @TableField(exist = false)
    private Integer messageReceiver;

    @TableField(exist = false)
    private Boolean messageReadFlag = false;

    /**
     * 对话ID
     */
    private Integer dialogueId;

    /**
     * 逻辑删除（0正常1删除）
     */
    private Integer delFlag;


}
